/*
 * @Author: fhw
 * @Date: 2022-07-30 15:55:50
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2023-02-17 16:30:24
 * @Description:
 */
import { ApiProperty } from '@nestjs/swagger';
import {
  CreateDateColumn,
  PrimaryGeneratedColumn,
  UpdateDateColumn,
} from 'typeorm';
export class PaginatedResult {
  @ApiProperty({ example: 'pageSize', description: '数量' })
  pageSize: number;
  @ApiProperty({ example: 'pageNum', description: '页数' })
  pageNum: number;
  @ApiProperty({ example: 'total', description: '总数' })
  total: number;
}

export class BaseEntity {
  @ApiProperty({ example: 'id', description: 'id' })
  @PrimaryGeneratedColumn({
    type: 'int',
    comment: 'id',
  })
  id: number;

  /** 创建时间 */
  @ApiProperty({ example: 'createDate', description: '创建时间' })
  @CreateDateColumn({
    type: 'datetime',
    comment: '创建时间',
  })
  createDate: string;

  /** 更新时间 */
  @ApiProperty({ example: 'updateDate', description: '更新时间' })
  @UpdateDateColumn({
    type: 'datetime',
    comment: '更新时间',
  })
  updateDate: string;
}
